package com.woniuxy.yygh.msm.utils;

import com.baomidou.mybatisplus.annotation.Version;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import javax.validation.Valid;

/**
 * <P> @Author: ideaAdmin
 * <P> TODO: Class
 * <P> TODO: 读取短信的配置类
 * <P> Date: 2022/3/3:20:32
 * <P> Description:
 */
@Component
public class ConstantPropertiesUtils implements InitializingBean {
    @Value("${aliyun.sms.regionId}")
    private String regionId;

    @Value("${aliyun.sms.accessKeyId}")
    private String accessKeyId;

    @Value("${aliyun.sms.secret}")
    private String secret;


    public static String REGION_Id;
    public static String ACCESS_KEY_ID;
    public static String SECRECT;

    /**
        * TODO: 获得key然后注入到final类中
    **/
    @Override
    public void afterPropertiesSet() throws Exception {
        REGION_Id = regionId;
        ACCESS_KEY_ID = accessKeyId;
        SECRECT = secret;
    }
}
